//
//  NSString+Verify.h
//  WC
//
//  Created by 杨鑫 on 15/4/28.
//  Copyright (c) 2015年 智康. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <CoreGraphics/CGGeometry.h>

@interface NSString (Utilities)

+ (CGSize)sizeInFrame:(CGSize)frame attributedString:(NSAttributedString *)attrStr;

/**
 *  距离转化
 *
 *  @param distance double
 *
 *  @return NSString
 */
+ (NSString *)distanceToString:(float)distance;

/**
 *  距离转化, 2000 to 二公里内
 *
 *  @param number float
 *
 *  @return NSString
 */
+ (NSString *)radiusToChString:(int)radius;

/**
 *  字典,array转化为JsonString
 *
 *  @param dictionary NSDictionary
 *
 *  @return NSString
 */
+ (NSString *)dataToJsonString:(id)data;

/**
 *  md5加密
 *
 *  @return NSString
 */
- (NSString *)md5String;

/**
 *  字符串转化为日期
 *
 *  @param dateformatter NSString
 *
 *  @return NSDate
 */
- (NSDate *)toDate:(NSString *)dateformatter;

/**
 *  没有相关信息的段落
 *
 *  @return NSMutableAttributedString
 */
- (NSMutableAttributedString *)noInfoAttributedStringWithIcon:(NSString *)iconName insertPosition:(NSInteger)index;

//去除首位空白字符，返回新的字符串
- (NSString *)trim;
- (BOOL)hasSpace;
- (BOOL)isEmpty;
- (BOOL)isMobile;
- (BOOL)isPassword;
- (BOOL)isEmail;
- (BOOL)isMoney;

+ (NSString *)timeToString:(long long)time;
+ (NSString *)timeStringYYMMDDFrom:(long long)time;

- (BOOL )isInvalidValue;
@end
